/*
 *
 *
 A(int)
10
A(const A&)
10
A(const A&)
10

 */


#include <iostream>
using namespace std;
class A{
	public:
		int m_data;
		A(int data = 10){
			cout << "A(int)" << endl;
			m_data = data;
		}
		A(const A& that){  //拷贝构造函数
			cout << "A(const A&)" << endl;
			m_data = that.m_data;
		}
		void print(){
			cout << m_data << endl;
		}
};
int main(void){

	A a1;
	a1.print();
	
	A a2(a1); //编译器会调用拷贝构造函数
	a2.print();

	A a3 = a1; //调用拷贝构造
	a3.print();

	return 0;
}
